home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / dispatch.gl.p < prev    next >
Text File  |  2003-09-23  |  18KB  |  657 lines

  1. {
  2.  
  3.   Hidden = TRUE;
  4.   ScriptID = script {    
  5.     @show {
  6.       int i;
  7.       int time;
  8.       str city_name;
  9.       str city_state;
  10.       str time_string;
  11.       str instruction;
  12.       str com_name;
  13.       str tmp;
  14.       resid tmp_id;
  15.       resid csv_data_id;
  16.           resid city_data_id;
  17.           resid state_data_id;
  18.           resid Player;
  19.           resid Scenario;
  20.           resid CurCommodity;
  21.           
  22.           Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
  23.           Scenario = ResPropGetResID(Player,"scenario_id");        
  24.  
  25.       /* get player view city information */
  26.       csv_data_id = ResByName("CSVData");
  27.       city_data_id = ResPropGetResID(csv_data_id, "city_id");
  28.       state_data_id = ResPropGetResID(csv_data_id, "state_id");
  29.  
  30.       time          = ResPropGetInt(Player,"time_now");     
  31.       time_string   = StrFormatStr("%s %d, %d", StrCapFirst(TimeGetMonthStr(time)), TimeGetDay(time), TimeGetYear(time));      
  32.       
  33.       city_name     = ResPropGetStr(Scenario,"scenario_start_city");
  34.       city_state    = ResPropGetStr(Scenario,"scenario_start_state"); 
  35.       
  36.       ResPropSetStr(GuiChildByName(SELF,"print_date"),"InputText", time_string);
  37.       ResPropSetStr(GuiChildByName(SELF,"driver_name"),"InputText",ResPropGetStr(Player,"player_name"));
  38.       ResPropSetStr(GuiChildByName(SELF,"start_location_city"),"InputText", StrFormatStr("%s,",city_name));
  39.       ResPropSetStr(GuiChildByName(SELF,"start_location_state"),"InputText", StrFormatStr("%s",city_state));
  40.             
  41.       city_name     = ResPropGetStr(Scenario,"scenario_end_city");
  42.       city_state    = ResPropGetStr(Scenario,"scenario_end_state");    
  43.       
  44.       ResPropSetStr(GuiChildByName(SELF,"destination_city"),"InputText", StrFormatStr("%s,",city_name));
  45.       ResPropSetStr(GuiChildByName(SELF,"destination_state"),"InputText", StrFormatStr("%s",city_state));     
  46.       
  47.       instruction = StrFormatStr(MangleSIDToStr(344/*"Your assignment is to pick up the following %d commodities and deliver them to %s."*/),ResPropGetInt(Scenario,"scenario_commodity_number_of"),ResPropGetStr(Scenario,"scenario_end_city"));
  48.       ResPropSetStr(GuiChildByName(SELF,"instruction"),"InputText",instruction); 
  49.       i = 0;
  50.       /* display commodities text and checkbox */
  51.       while (i < ResPropGetInt(Scenario,"scenario_commodity_number_of")) {
  52.         ResPropSetStr(GuiChildByName(SELF,StrFormatStr("text%d",i+1)),"InputText", StrFormatStr(MangleSIDToStr(345/*"Pick up %s"*/),ResPropGetStr(Scenario,StrFormatStr("scenario_commodity_name_%d",i+1))));                       
  53.         tmp = StrFormatStr("commodity_%d",i+1);
  54.         CurCommodity = ResPropGetResID(Player,tmp);
  55.         tmp = StrFormatStr("dispatch.gl/checkbox%d",i+1);
  56.         tmp_id = ResByName(tmp);
  57.  
  58.         if(ResPropGetInt(CurCommodity,"commodity_state") == 1) {
  59.           ResPropSetResID(tmp_id,"ActiveButtonID",GuiChildByName(tmp_id,"commodity_checked"));
  60.         } else {
  61.           ResPropSetResID(tmp_id,"ActiveButtonID",GuiChildByName(tmp_id,"commodity_unchecked"));
  62.         }
  63.         ResPropSetInt(tmp_id, "Disabled", 1);
  64.         ResPropSetInt(tmp_id, "Hidden", FALSE);
  65.         i+=1;
  66.       }
  67.      
  68.       /* display bonus commodities (text and checkbox) */    
  69.       CurCommodity = ResPropGetResID(Player,"commodity_bonus");
  70.       com_name = ResPropGetStr(CurCommodity, "commodity_name");
  71.       if (!StrExact(com_name, "")) {
  72.         ResPropSetStr(GuiChildByName(SELF,StrFormatStr("text%d",i+1)),"InputText", StrFormatStr(MangleSIDToStr(346/*"Bonus: pick up %s"*/),com_name));
  73.       
  74.         tmp = StrFormatStr("dispatch.gl/checkbox%d",i+1);
  75.         tmp_id = ResByName(tmp);
  76.  
  77.         if(ResPropGetInt(CurCommodity,"commodity_state") == 1) {
  78.           ResPropSetResID(tmp_id,"ActiveButtonID",GuiChildByName(tmp_id,"commodity_checked"));
  79.         } else {
  80.           ResPropSetResID(tmp_id,"ActiveButtonID",GuiChildByName(tmp_id,"commodity_unchecked"));
  81.         }
  82.         ResPropSetInt(tmp_id, "Disabled", 1);
  83.         ResPropSetInt(tmp_id, "Hidden", FALSE);      
  84.         i+=1;
  85.       }
  86.       
  87.       /* display destination text and checkbox */
  88.       ResPropSetStr(GuiChildByName(SELF,StrFormatStr("text%d",i+1)),"InputText", StrFormatStr(MangleSIDToStr(347/*"Deliver to %s"*/),ResPropGetStr(Scenario,"scenario_end_city")));
  89.  
  90.       tmp = StrFormatStr("dispatch.gl/checkbox%d",i+1);
  91.       tmp_id = ResByName(tmp);
  92.  
  93.       if(ResPropGetInt(Player,"player_destination_arrived") == 1) {
  94.         ResPropSetResID(tmp_id,"ActiveButtonID",GuiChildByName(tmp_id,"commodity_checked"));
  95.       } else {
  96.         ResPropSetResID(tmp_id,"ActiveButtonID",GuiChildByName(tmp_id,"commodity_unchecked"));
  97.       }
  98.       ResPropSetInt(tmp_id, "Disabled", 1);
  99.       ResPropSetInt(tmp_id, "Hidden", FALSE);
  100.    
  101.       /* display delivered picture if player arrive destination */
  102.       if (ResPropGetInt(Player, "player_destination_arrived") == 1) {
  103.         ResPropSetInt(GuiChildByName(SELF ,"delivered_pic"), "Hidden", FALSE);
  104.       } else {
  105.         ResPropSetInt(GuiChildByName(SELF, "delivered_pic"), "Hidden", TRUE);
  106.       }
  107.     }    
  108.   };    /* END OF MAIN SCRIPT */
  109.   
  110.   ChildID = {
  111.     GuiAnimation("background") {
  112.       AnimationID = "image/dispatch.pcx";
  113.       X = 0;
  114.       Y = 0;
  115.       },
  116.      
  117.     GuiAnimation("delivered_pic") {
  118.       AnimationID = "image/delivered_stamp.pcx";
  119.       X = 200;
  120.       Y = 150;
  121.       },
  122.       
  123.     GuiTextInput("driver") {
  124.           X = 50;
  125.           Y = 140;
  126.           Width = 60;
  127.           Height = 25;
  128.       TextX = -150;         
  129.       InputDisabled = TRUE;
  130.           FontID = "font/verdana_black_bold_12.tf";
  131.           InputText = Mangle(299/*"Driver:"*/);
  132.         },
  133.     GuiTextInput("driver_name") {
  134.           X = 115;
  135.           Y = 140;
  136.           Width = 150;
  137.           Height = 25;
  138.       TextX = -150;         
  139.       InputDisabled = TRUE;
  140.           FontID = "font/verdana_black_bold_12.tf";
  141.           InputText = "";
  142.         },
  143.         
  144.     GuiTextInput("date") {
  145.           X = 60;
  146.           Y = 175;
  147.           Width = 60;
  148.           Height = 25;
  149.       TextX = -150;         
  150.       InputDisabled = TRUE;     
  151.           FontID = "font/verdana_black_bold_12.tf";
  152.           InputText = Mangle(300/*"Date:"*/);
  153.         },
  154.         GuiTextInput("print_date") {
  155.           X = 115;
  156.           Y = 175;
  157.           Width = 190;
  158.           Height = 25;
  159.       TextX = -150;         
  160.       InputDisabled = TRUE;    
  161.           FontID = "font/verdana_black_bold_12.tf";
  162.           InputText = "";
  163.         },
  164.     GuiTextInput("start_location") {
  165.           X = 281;
  166.           Y = 140;
  167.           Width = 120;
  168.           Height = 25;
  169.       TextX = -150;          
  170.       InputDisabled = TRUE;       
  171.           FontID = "font/verdana_black_bold_12.tf";
  172.           InputText = Mangle(301/*"Start Location:"*/);
  173.         },
  174.         GuiTextInput("start_location_city") {
  175.           X = 405;
  176.           Y = 133;
  177.           Width = 190;
  178.           Height = 25;
  179.       TextX = -150;         
  180.       InputDisabled = TRUE;       
  181.           FontID = "font/verdana_black_bold_12.tf";
  182.           InputText = "";
  183.         },
  184.             GuiTextInput("start_location_state") {
  185.           X = 405;
  186.           Y = 150;
  187.           Width = 190;
  188.           Height = 25;
  189.       TextX = -150;         
  190.       InputDisabled = TRUE;       
  191.           FontID = "font/verdana_black_bold_12.tf";
  192.           InputText = "";
  193.         },
  194.         GuiTextInput("destination") {
  195.           X = 300;
  196.           Y = 175;
  197.           Width = 105;
  198.           Height = 25;
  199.       TextX = -150;         
  200.       InputDisabled = TRUE;        
  201.           FontID = "font/verdana_black_bold_12.tf";
  202.           InputText = Mangle(302/*"Destination:"*/);
  203.         },
  204.     GuiTextInput("destination_city") {
  205.           X = 405;
  206.           Y = 168;
  207.           Width = 190;
  208.           Height = 25;
  209.       TextX = -150;         
  210.       InputDisabled = TRUE;       
  211.           FontID = "font/verdana_black_bold_12.tf";
  212.           InputText = "";
  213.         },
  214.          GuiTextInput("destination_state") {
  215.           X = 405;
  216.           Y = 185;
  217.           Width = 190;
  218.           Height = 25;
  219.       TextX = -150;         
  220.       InputDisabled = TRUE;       
  221.           FontID = "font/verdana_black_bold_12.tf";
  222.           InputText = "";
  223.         },
  224.         GuiTextInput("assignment") {
  225.       X = 60;
  226.       Y = 75;
  227.       Width = 100;
  228.           Height = 25;
  229.       InputVerticalAlign = TOP;
  230.       InputDisabled = TRUE;  
  231.       InputText = Mangle(303/*"Assignment"*/);
  232.       WordWrap = 1;
  233.           FontID = "font/verdana_black_bold_12.tf";
  234.     },
  235.         GuiTextInput("instruction") {
  236.       X = 70;
  237.       Y = 95;
  238.       Width = 500;
  239.       Height = 40;
  240.       InputVerticalAlign = TOP;
  241.       InputDisabled = TRUE;  
  242.       InputText = "";
  243.       WordWrap = 1;
  244.           FontID = "font/verdana_black_bold_12.tf";
  245.     },
  246.     
  247.     /* ========================
  248.      * GUI for commodities 
  249.      ==========================*/  
  250.    
  251.    GuiButtonGroup("checkbox1") {
  252.       X = 58;
  253.       Y = 225; 
  254.       Hidden = TRUE;
  255.       ChildID = {
  256.         GuiButton("commodity_checked") {
  257.           X = 0;
  258.           Y = 0;
  259.           UpID = "gui/laptop/map_button/check_on.pcx";
  260.         },  
  261.  
  262.         GuiButton("commodity_unchecked") {
  263.           X = 0;
  264.           Y = 0;
  265.           UpID = "gui/laptop/map_button/check_off.pcx";
  266.         }
  267.       };
  268.     },
  269.                     
  270.     GuiTextInput("text1") {
  271.           X = 95;
  272.           Y = 232;
  273.           Width = 210;
  274.           Height = 25;
  275.           InputDisabled = TRUE;  
  276.           FontID = "font/verdana_black_bold_12.tf";
  277.       InputText = "";
  278.         },
  279.         
  280.   GuiButtonGroup("checkbox2") {
  281.       X = 58;
  282.       Y = 255; 
  283.       Hidden = TRUE;
  284.       ChildID = {
  285.         GuiButton("commodity_checked") {
  286.           X = 0;
  287.           Y = 0;
  288.           UpID = "gui/laptop/map_button/check_on.pcx";
  289.         },  
  290.  
  291.         GuiButton("commodity_unchecked") {
  292.           X = 0;
  293.           Y = 0;
  294.           UpID = "gui/laptop/map_button/check_off.pcx";
  295.         }
  296.       };
  297.     },
  298.     
  299.     GuiTextInput("text2") {
  300.           X = 95;
  301.           Y = 263;
  302.           Width = 210;
  303.           Height = 25;
  304.       InputDisabled = TRUE;  
  305.           FontID = "font/verdana_black_bold_12.tf";
  306.           InputText = "";
  307.         },
  308.         
  309.         GuiButtonGroup("checkbox3") {
  310.       X = 58;
  311.       Y = 286;
  312.       Hidden = TRUE;  
  313.       ChildID = {
  314.         GuiButton("commodity_checked") {
  315.           X = 0;
  316.           Y = 0;
  317.           UpID = "gui/laptop/map_button/check_on.pcx";
  318.         },  
  319.  
  320.         GuiButton("commodity_unchecked") {
  321.           X = 0;
  322.           Y = 0;
  323.           UpID = "gui/laptop/map_button/check_off.pcx";
  324.         }
  325.       };
  326.     },    
  327.     GuiTextInput("text3") {
  328.           X = 95;
  329.           Y = 294;
  330.           Width = 210;
  331.           Height = 25;
  332.           InputDisabled = TRUE;  
  333.           FontID = "font/verdana_black_bold_12.tf";
  334.           InputText = "";
  335.         },
  336.         
  337.         GuiButtonGroup("checkbox4") {
  338.       X = 58;
  339.       Y = 317; 
  340.       Hidden = TRUE; 
  341.       ChildID = {
  342.         GuiButton("commodity_checked") {
  343.           X = 0;
  344.           Y = 0;
  345.           UpID = "gui/laptop/map_button/check_on.pcx";
  346.         },  
  347.  
  348.         GuiButton("commodity_unchecked") {
  349.           X = 0;
  350.           Y = 0;
  351.           UpID = "gui/laptop/map_button/check_off.pcx";
  352.         }
  353.       };
  354.     },    
  355.     GuiTextInput("text4") {
  356.           X = 95;
  357.           Y = 325;
  358.           Width = 210;
  359.           Height = 25;
  360.           InputDisabled = TRUE;  
  361.           FontID = "font/verdana_black_bold_12.tf";
  362.           InputText = "";
  363.         },
  364.         
  365.         GuiButtonGroup("checkbox5") {
  366.       X = 58;
  367.       Y = 350; 
  368.       Hidden = TRUE; 
  369.       ChildID = {
  370.         GuiButton("commodity_checked") {
  371.           X = 0;
  372.           Y = 0;
  373.           UpID = "gui/laptop/map_button/check_on.pcx";
  374.         },  
  375.  
  376.         GuiButton("commodity_unchecked") {
  377.           X = 0;
  378.           Y = 0;
  379.           UpID = "gui/laptop/map_button/check_off.pcx";
  380.         }
  381.       };
  382.     },    
  383.     GuiTextInput("text5") {
  384.           X = 95;
  385.           Y = 357;
  386.           Width = 210;
  387.           Height = 25;
  388.           InputDisabled = TRUE;  
  389.           FontID = "font/verdana_black_bold_12.tf";
  390.           InputText = "";
  391.         },
  392.         
  393.         GuiButtonGroup("checkbox6") {
  394.       X = 58;
  395.       Y = 380;  
  396.       Hidden = TRUE;  
  397.       ChildID = {
  398.         GuiButton("commodity_checked") {
  399.           X = 0;
  400.           Y = 0;
  401.           UpID = "gui/laptop/map_button/check_on.pcx";
  402.         },  
  403.  
  404.         GuiButton("commodity_unchecked") {
  405.           X = 0;
  406.           Y = 0;
  407.           UpID = "gui/laptop/map_button/check_off.pcx";
  408.         }
  409.       };
  410.     },    
  411.     GuiTextInput("text6") {
  412.           X = 95;
  413.           Y = 388;
  414.           Width = 210;
  415.           Height = 25;
  416.           InputDisabled = TRUE;  
  417.           FontID = "font/verdana_black_bold_12.tf";
  418.           InputText = "";
  419.         },        
  420.         
  421.         GuiButtonGroup("checkbox7") {
  422.       X = 58;
  423.       Y = 412; 
  424.       Hidden = TRUE;
  425.       ChildID = {
  426.         GuiButton("commodity_checked") {
  427.           X = 0;
  428.           Y = 0;
  429.           UpID = "gui/laptop/map_button/check_on.pcx";
  430.         },  
  431.  
  432.         GuiButton("commodity_unchecked") {
  433.           X = 0;
  434.           Y = 0;
  435.           UpID = "gui/laptop/map_button/check_off.pcx";
  436.         }
  437.       };
  438.     },    
  439.     GuiTextInput("text7") {
  440.           X = 95;
  441.           Y = 420;
  442.           Width = 210;
  443.           Height = 25;
  444.           InputDisabled = TRUE;  
  445.           FontID = "font/verdana_black_bold_12.tf";
  446.           InputText = "";
  447.         },        
  448.         
  449.         GuiButtonGroup("checkbox8") {
  450.       X = 320;
  451.       Y = 225;  
  452.       Hidden = TRUE;
  453.       ChildID = {
  454.         GuiButton("commodity_checked") {
  455.           X = 0;
  456.           Y = 0;
  457.           UpID = "gui/laptop/map_button/check_on.pcx";
  458.         },  
  459.  
  460.         GuiButton("commodity_unchecked") {
  461.           X = 0;
  462.           Y = 0;
  463.           UpID = "gui/laptop/map_button/check_off.pcx";
  464.         }
  465.       };
  466.     },        
  467.     GuiTextInput("text8") {
  468.           X = 357;
  469.           Y = 232;
  470.           Width = 235;
  471.           Height = 25;
  472.           InputDisabled = TRUE;  
  473.           FontID = "font/verdana_black_bold_12.tf";
  474.           InputText = "";
  475.         },
  476.         
  477.         GuiButtonGroup("checkbox9") {
  478.       X = 320;
  479.       Y = 255;  
  480.       Hidden = TRUE;
  481.       ChildID = {
  482.         GuiButton("commodity_checked") {
  483.           X = 0;
  484.           Y = 0;
  485.           UpID = "gui/laptop/map_button/check_on.pcx";
  486.         },  
  487.  
  488.         GuiButton("commodity_unchecked") {
  489.           X = 0;
  490.           Y = 0;
  491.           UpID = "gui/laptop/map_button/check_off.pcx";
  492.         }
  493.       };
  494.     },    
  495.     GuiTextInput("text9") {
  496.           X = 357;
  497.           Y = 263;
  498.           Width = 235;
  499.           Height = 25;
  500.           InputDisabled = TRUE;  
  501.           FontID = "font/verdana_black_bold_12.tf";
  502.           InputText = "";
  503.         },
  504.         
  505.         GuiButtonGroup("checkbox10") {
  506.       X = 320;
  507.       Y = 286; 
  508.       Hidden = TRUE;
  509.       ChildID = {
  510.         GuiButton("commodity_checked") {
  511.           X = 0;
  512.           Y = 0;
  513.           UpID = "gui/laptop/map_button/check_on.pcx";
  514.         },  
  515.  
  516.         GuiButton("commodity_unchecked") {
  517.           X = 0;
  518.           Y = 0;
  519.           UpID = "gui/laptop/map_button/check_off.pcx";
  520.         }
  521.       };
  522.     },    
  523.     GuiTextInput("text10") {
  524.           X = 357;
  525.           Y = 294;
  526.           Width = 235;
  527.           Height = 25;
  528.           InputDisabled = TRUE;  
  529.           FontID = "font/verdana_black_bold_12.tf";
  530.           InputText = "";
  531.         },
  532.         
  533.         
  534.         GuiButtonGroup("checkbox11") {
  535.       X = 320;
  536.       Y = 317;  
  537.       Hidden = TRUE;  
  538.       ChildID = {
  539.         GuiButton("commodity_checked") {
  540.           X = 0;
  541.           Y = 0;
  542.           UpID = "gui/laptop/map_button/check_on.pcx";
  543.         },  
  544.  
  545.         GuiButton("commodity_unchecked") {
  546.           X = 0;
  547.           Y = 0;
  548.           UpID = "gui/laptop/map_button/check_off.pcx";
  549.         }
  550.       };
  551.     },    
  552.     GuiTextInput("text11") {
  553.           X = 357;
  554.           Y = 325;
  555.           Width = 235;
  556.           Height = 25;
  557.           InputDisabled = TRUE;  
  558.           FontID = "font/verdana_black_bold_12.tf";
  559.           InputText = "";
  560.         },        
  561.         
  562.         GuiButtonGroup("checkbox12") {
  563.       X = 320;
  564.       Y = 350;  
  565.       Hidden = TRUE;
  566.       ChildID = {
  567.         GuiButton("commodity_checked") {
  568.           X = 0;
  569.           Y = 0;
  570.           UpID = "gui/laptop/map_button/check_on.pcx";
  571.         },  
  572.  
  573.         GuiButton("commodity_unchecked") {
  574.           X = 0;
  575.           Y = 0;
  576.           UpID = "gui/laptop/map_button/check_off.pcx";
  577.         }
  578.       };
  579.     },    
  580.     GuiTextInput("text12") {
  581.           X = 357;
  582.           Y = 357;
  583.           Width = 235;
  584.           Height = 25;
  585.           InputDisabled = TRUE;  
  586.           FontID = "font/verdana_black_bold_12.tf";
  587.           InputText = "";
  588.         },        
  589.         
  590.         GuiButtonGroup("checkbox13") {
  591.       X = 320;
  592.       Y = 380;  
  593.       Hidden = TRUE;
  594.       ChildID = {
  595.         GuiButton("commodity_checked") {
  596.           X = 0;
  597.           Y = 0;
  598.           UpID = "gui/laptop/map_button/check_on.pcx";
  599.         },  
  600.  
  601.         GuiButton("commodity_unchecked") {
  602.           X = 0;
  603.           Y = 0;
  604.           UpID = "gui/laptop/map_button/check_off.pcx";
  605.         }
  606.       };
  607.     },    
  608.     GuiTextInput("text13") {
  609.           X = 357;
  610.           Y = 388;
  611.           Width = 235;
  612.           Height = 25;
  613.           InputDisabled = TRUE;  
  614.           FontID = "font/verdana_black_bold_12.tf";
  615.           InputText = "";
  616.         },    
  617.         
  618.         GuiButtonGroup("checkbox14") {
  619.       X = 320;
  620.       Y = 412;   
  621.       Hidden = TRUE;
  622.       ChildID = {
  623.         GuiButton("commodity_checked") {
  624.           X = 0;
  625.           Y = 0;
  626.           UpID = "gui/laptop/map_button/check_on.pcx";
  627.         },  
  628.  
  629.         GuiButton("commodity_unchecked") {
  630.           X = 0;
  631.           Y = 0;
  632.           UpID = "gui/laptop/map_button/check_off.pcx";
  633.         }
  634.       };
  635.     },
  636.     GuiTextInput("text14") {
  637.           X = 357;
  638.           Y = 420;
  639.           Width = 235;
  640.           Height = 25;
  641.           InputDisabled = TRUE;  
  642.           FontID = "font/verdana_black_bold_12.tf";
  643.           InputText = "";
  644.         },    
  645.         
  646.         GuiTextInput("screen_name") {
  647.       X = 30;
  648.       Y = 40;
  649.           Width = 200;
  650.           Height = 20;
  651.           FontID = "font/verdana_9.tf";
  652.       InputDisabled = TRUE;      
  653.           InputText = Mangle(305/*"Dispatch"*/);
  654.         }
  655.   };  
  656. }
  657.